﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewsWcfWebService
{
    public class ServiceFactory
    {
        public void getDataFromBaoTuoiTre()
        {
            List<ItemNewsInfo> listCatelogesMenu = new List<ItemNewsInfo>();
            listCatelogesMenu =  tuoitreGetInfo.getCatelogesMenu();
            foreach (ItemNewsInfo item in listCatelogesMenu)
            {
                List<ItemNewsInfo> listSubCateloges = tuoitreGetInfo.getSubCatelogesMenuWithUrl(item.Url);
                item.ListCateloges = listSubCateloges;
                foreach (ItemNewsInfo subItem in listSubCateloges)
                {
                    List<ItemNewsInfo> listNews = tuoitreGetInfo.getNewsListWithUrl(subItem.Url);
                    subItem.ListCateloges = listNews;
                    foreach (ItemNewsInfo content in listNews)
                    {
                        ItemNewsInfo info = tuoitreGetInfo.getContentNewsFromUrl(content.Url);
                        
                    }
                }
            }
            ManagerVarible.dataNewsLocal = listCatelogesMenu;
        }
    }
}
